import http from "@/api";
import { ResPage } from "@/api/interface";
import {
  ApiSysRolePermissionsCreate,
  ApiSysRolePermissionsDelete,
  ApiSysRolePermissionsSave,
  ApiSysRolePermissionsSearch,
  ApiSysRolePermissionsUpdate
} from "@/api/apis/sys_role_permissions";
import { ReqSearch } from "@/api/interface/Search/ReqSearch";
import {
  dtoSysRolePermissionsCreate,
  dtoSysRolePermissionsDelete,
  dtoSysRolePermissionsInfo,
  dtoSysRolePermissionsUpdate
} from "@/api/dbdto/dtoSysRolePermissions";
import { RequestSysRolePermissionsSave } from "@/api/interface/SysRolePermission/RequestSysRolePermissionsSave";

export const requestSysRolePermissionsCreate = (params: dtoSysRolePermissionsCreate) => {
  return http.post(ApiSysRolePermissionsCreate, params);
};

export const requestSysRolePermissionsSearch = (params: ReqSearch) => {
  return http.post<ResPage<dtoSysRolePermissionsInfo>>(ApiSysRolePermissionsSearch, params);
};

export const requestSysRolePermissionsUpdate = (params: dtoSysRolePermissionsUpdate) => {
  return http.post(ApiSysRolePermissionsUpdate, params);
};

export const requestSysRolePermissionsDelete = (params: dtoSysRolePermissionsDelete) => {
  return http.post(ApiSysRolePermissionsDelete, params);
};

export const requestSysRolePermissionsSave = (params: RequestSysRolePermissionsSave) => {
  return http.post(ApiSysRolePermissionsSave, params);
};
